from flask import request,jsonify
import json
from qiniu import Auth


def gain_data():
    data = request.data
    if data:
        data = json.loads(data)
    else:
        data = request.form
        
    return data


# 需要填写你的 Access Key 和 Secret Key
access_key = 'dKtWTFQDFafGhq6qd6_AbLgrhGniCCWuGBULRHcL'
secret_key = 'Lrg7-Aj73GJ6XbMnNi_KiNs5rNt4suP8iZrYLyPa'

# 域名  ：r33upz90c.hb-bkt.clouddn.com

def qntoken():
    q = Auth(access_key, secret_key)
    # 要上传的空间
    bucket_name = 'bee-movie'
    # 生成上传 Token
    token = q.upload_token(bucket_name)
    return token